<?php
	//
	class GalleryModel{
		//
		public function CheckFileType($photo){		
			//
			if (($photo["file"]["type"] == "image/png") || ($photo["file"]["type"] == "image/jpg") || ($photo["file"]["type"] == "image/jpeg")) {
				return true;				
			}
			return false;
		}
		//
		public function DoesExist($photo){
			//
			if (!file_exists("Gallery/Photos/" . $photo["file"]["name"])) {
				return true;
			}
			return false;
		}
		//
		public function SavePhoto($photo){
			move_uploaded_file($photo["file"]["tmp_name"], "Gallery/Photos/" . $photo["file"]["name"]);
		}
	}
?>